<template>
  <div id="App">
    <MyTable :list="list">
      <template #counijiwa="obj">
        <button @click="clear(obj.id)">删除</button>
      </template>
    </MyTable>
  </div>
</template>

<script>
import MyTable from './components/MyTable.vue'
export default {
  data() {
    return {
      list: [
        { id: 1, name: '张三', age: 18, gender: '男' },
        { id: 2, name: '李四', age: 28, gender: '男' },
        { id: 3, name: '王五', age: 38, gender: '女' }
      ]
    }
  },
  components: {
    MyTable
  },
  methods: {
    clear(id) {
      this.list = this.list.filter(item => item.id !== id)
    }
  }
}
</script>

<style></style>